package com.bjsxt.mapper;

import com.bjsxt.pojo.RoleMenu;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface RoleMenuMapper {
    @Insert("insert into t_role_menu values(#{param1},#{param2})")
    Integer insertRoleMenu(Integer rid,Integer mid);

    //关联menu的表的目的是为了控制status的值,这点很重要,通过关联表来控制条件
    @Select("select rm.mid from t_role_menu rm join t_menu m on rm.mid=m.mid where rid=#{param1} and status=1")
    List<Integer> selectmid(Integer rid);

    @Delete("delete from t_role_menu where rid=#{param1}")
    Integer deleteRoleMenu(Integer rid);
}
